<?php
   
   define('ACC', true);
require_once('../include/init.php');
   // require('../include/init.php');
  
   $data = $_POST;
   $data['regtime'] = date('Y-m-d H:i:s');  //time();
   $user = new userModel;


   //添加验证
   // echo $user->_validate($data)?'验证成功':'验证失败';
   if(!$user->_validate($data)){

   	   // print_r($user->getErr()[0]); exit;
   	   $messge = $user->getErr()[0];
   	   include('../view/front/messge.html'); exit();
   }

  //自动过滤
   $data = $user->shiftData($data);


   if($user->reg($data)){
   	   $messge = '添加成功';
   }else{
       $messge = '添加失败';
   };


require_once('../view/front/messge.html');
  


?>